/**
 * 
 */
package durak.client.control;

import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;

import durak.client.view.LoginToDurak;

/**
 * @author miri
 * 
 */
public class Client {

	ClientSessionControl serverSession;

	/**
	 * 
	 */
	public Client(String[] args) {
		ClientPlayerControl playerControl = new ClientPlayerControl();
		try {
			serverSession = new ClientSessionControl(InetAddress.getByName(args[0]), Integer.parseInt(args[1]), args[2], playerControl);
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (UnknownHostException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		playerControl.setClientSessionControl(serverSession);
		new Thread(serverSession).start();
	}

	public Client() {
		// TODO Auto-generated constructor stub
	}

	/**
	 * @param args
	 * @throws IOException
	 * @throws UnknownHostException
	 */
	public static void main(String[] args) throws UnknownHostException,
			IOException {
		//Client client = new Client(args);
		LoginToDurak loginWindow = new LoginToDurak(); 
		loginWindow.setVisible(true);
	}

}
